//
//  main.cpp
//  L15Containers
//
//  Created by ai-nixs on 2017/10/29.
//  Copyright © 2017年 nixinsheng. All rights reserved.
//

#include <iostream>
using namespace std;
#include <list>
#include <string>
#include <map>

//字符串类型数据插入
#define PAIR(key,value) pair<string, string>(key,value)


int main(int argc, const char * argv[]) {
    list<string> l;
    l.push_back("hello,");
    l.push_back("JKXY.");
    
    //遍历 list容器
    for (list<string>::iterator it=l.begin(); it!=l.end(); it++) {
        cout<<*it<<endl;
    }
    
    map<string,string> m;
    m.insert(pair<string, string>("hello","HELLO,JKXY."));
    //m.insert(pair<string, string>("name","NIXINSHENG."));
    m.insert(PAIR("name", "倪新生"));
    
    m["sex"] = "男";//重载[]运算符
    
    
    cout<<m.at("hello")<<endl;
    cout<<m.at("name")<<endl;
    cout<<m.at("sex")<<endl;
    
    return 0;
}
